<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
  <head>
    <title>Traditional Shared Lib</title>
    <meta name="generator" content="Muse">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    
    <link rel="stylesheet" type="text/css"charset="utf-8" media="all" href="../../styles/common.css"  />

    <script src="../../scripts/jsMath/easy/load.js"></script>
  </head>

  <body>

    <h1>Traditional Shared Lib
      <!-- menu start here -->
      <div class="menu">
        <div class="menuitem">
          <a href="../../home/index.html">Home</a>
        </div>
        <div class="menuitem">
          <a href="../../courses/index.html">Courses</a>
        </div>
        <div class="menuitem">
          <a href="../../projects/index.html">Projects</a>
        </div>
        <div class="menuitem">
          <a href="../../complang/index.html">CompLang</a>
        </div>
        <div class="menuitem">
          <a href="../../code/index.html">CodeReading</a>
        </div>
        <div class="menuitem">
          <a href="../../software/index.html">Software</a>
        </div>
        <div class="menuitem">
          <a href="../../lectures/index.html">Lectures</a>
        </div>
      </div>
      <!-- menu ends here -->

    </h1>


    <!-- Page published by Emacs Muse begins here -->

<h2>Strace of Hello World program</h2>

<p class="first">Remove some traces not related to shared library loading</p>

<pre class="src">
execve(<span style="color: #00ff00;">"./hello_dynamic"</span>, [<span style="color: #00ff00;">"./hello_dynamic"</span>], [/* 54 vars */]) = 0
access(<span style="color: #00ff00;">"/etc/ld.so.nohwcap"</span>, F_OK)      = -1 ENOENT (No such file or directory)
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7836000
access(<span style="color: #00ff00;">"/etc/ld.so.preload"</span>, R_OK)      = -1 ENOENT (No such file or
directory)

open(<span style="color: #00ff00;">"/etc/ld.so.cache"</span>, O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=89403, ...}) = 0
mmap2(NULL, 89403, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7820000
close(3)                                = 0

access(<span style="color: #00ff00;">"/etc/ld.so.nohwcap"</span>, F_OK)      = -1 ENOENT (No such file or directory)
open(<span style="color: #00ff00;">"/lib/tls/i686/cmov/libc.so.6"</span>, O_RDONLY) = 3
read(3, <span style="color: #00ff00;">"\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\260l\1\0004\0\0\0"</span>..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1319364, ...}) = 0
mmap2(NULL, 1325416, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xa9f000
mmap2(0xbdd000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x13e) = 0xbdd000
mmap2(0xbe0000, 10600, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xbe0000
close(3)                                = 0

mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb781f000
mprotect(0xbdd000, 8192, PROT_READ)     = 0
mprotect(0xd25000, 4096, PROT_READ)     = 0
munmap(0xb7820000, 89403)               = 0

fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 4), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0xb7835000

write(1, <span style="color: #00ff00;">"Hello, World\n"</span>, 13Hello, World)          = 13

</pre>



<!-- Page published by Emacs Muse ends here -->
<hl />
<p />
<!-- <center> -->
<!--   Updated at  -->
<!--   2010-03-08 -->
<!-- </center> -->

<script type="text/javascript">
  var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
  document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
  try {
  var pageTracker = _gat._getTracker("UA-2241833-12");
  pageTracker._trackPageview();
  } catch(err) {}</script>

</body>
</html>

